package com.springboot.prac.redis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

/**
 * @Desc:
 * @Author: siyuanlong
 * @Date: 2022/2/20 22:50
 */
@Component
public class RedisPrac {
    @Autowired
    RedisTemplate redisTemplate;

    public void test01() {
        redisTemplate.opsForValue().set("name", "syl");

        Object name = redisTemplate.opsForValue().get("name");
        System.out.println("name = " + name);
    }

    public static void main(String[] args) {
        RedisPrac redisPrac = new RedisPrac();
        redisPrac.test01();
    }
}
